package com.ruoyi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ZhwyRentalcontractMapper;
import com.ruoyi.domain.ZhwyRentalcontract;
import com.ruoyi.service.IZhwyRentalcontractService;

/**
 * 租售合同Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-07
 */
@Service
public class ZhwyRentalcontractServiceImpl implements IZhwyRentalcontractService 
{
    @Autowired
    private ZhwyRentalcontractMapper zhwyRentalcontractMapper;

    /**
     * 查询租售合同
     * 
     * @param id 租售合同主键
     * @return 租售合同
     */
    @Override
    public ZhwyRentalcontract selectZhwyRentalcontractById(Long id)
    {
        return zhwyRentalcontractMapper.selectZhwyRentalcontractById(id);
    }

    /**
     * 查询租售合同列表
     * 
     * @param zhwyRentalcontract 租售合同
     * @return 租售合同
     */
    @Override
    public List<ZhwyRentalcontract> selectZhwyRentalcontractList(ZhwyRentalcontract zhwyRentalcontract)
    {
        return zhwyRentalcontractMapper.selectZhwyRentalcontractList(zhwyRentalcontract);
    }

    /**
     * 新增租售合同
     * 
     * @param zhwyRentalcontract 租售合同
     * @return 结果
     */
    @Override
    public int insertZhwyRentalcontract(ZhwyRentalcontract zhwyRentalcontract)
    {
        return zhwyRentalcontractMapper.insertZhwyRentalcontract(zhwyRentalcontract);
    }

    /**
     * 修改租售合同
     * 
     * @param zhwyRentalcontract 租售合同
     * @return 结果
     */
    @Override
    public int updateZhwyRentalcontract(ZhwyRentalcontract zhwyRentalcontract)
    {
        return zhwyRentalcontractMapper.updateZhwyRentalcontract(zhwyRentalcontract);
    }

    /**
     * 批量删除租售合同
     * 
     * @param ids 需要删除的租售合同主键
     * @return 结果
     */
    @Override
    public int deleteZhwyRentalcontractByIds(Long[] ids)
    {
        return zhwyRentalcontractMapper.deleteZhwyRentalcontractByIds(ids);
    }

    /**
     * 删除租售合同信息
     * 
     * @param id 租售合同主键
     * @return 结果
     */
    @Override
    public int deleteZhwyRentalcontractById(Long id)
    {
        return zhwyRentalcontractMapper.deleteZhwyRentalcontractById(id);
    }

    @Override
    public int rollbackById(Long id) {
        return zhwyRentalcontractMapper.rollbackHT(id);
    }

    @Override
    public Long findByReMarkAndTrade(String trade, String remark) {
        return zhwyRentalcontractMapper.selectByReMarkAndTrade(trade,remark);
    }
}
